package com.wei.rjoin;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class OrderInfo implements Writable{
	private String orderId;
	private String date;
	private String pid;
	private String amount;
	private String pname;
	private String categoryId;
	private String price;
	private String flag;
	
	
	
	public OrderInfo() {
	}
	
	
	
	public void set(String orderId, String date, String pid, String amount,
			String pname, String categoryId, String price, String flag) {
		this.orderId = orderId;
		this.date = date;
		this.pid = pid;
		this.amount = amount;
		this.pname = pname;
		this.categoryId = categoryId;
		this.price = price;
		this.flag = flag;
	}



	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
	public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	public String getAmount() {
		return amount;
	}
	public void setAmount(String amount) {
		this.amount = amount;
	}
	public String getPname() {
		return pname;
	}
	public void setPname(String pname) {
		this.pname = pname;
	}
	public String getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}



	@Override
	public void write(DataOutput out) throws IOException {
		out.writeUTF(orderId);
		out.writeUTF(date);
		out.writeUTF(pid);
		out.writeUTF(amount);
		out.writeUTF(pname);
		out.writeUTF(categoryId);
		out.writeUTF(price);
		out.writeUTF(flag);
	}



	@Override
	public void readFields(DataInput in) throws IOException {
		this.orderId= in.readUTF();
		this.date= in.readUTF();
		this.pid= in.readUTF();
		this.amount= in.readUTF();
		this.pname= in.readUTF();
		this.categoryId= in.readUTF();
		this.price= in.readUTF();
		this.flag= in.readUTF();
	}



	@Override
	public String toString() {
		return "orderId=" + orderId + ", date=" + date + ", pid="
				+ pid + ", amount=" + amount + ", pname=" + pname
				+ ", categoryId=" + categoryId + ", price=" + price;
	}
	
	
	

}
